

#ifndef IPMSG_H
#define IPMSG_H

/* IP Messenger Communication Protocol version 1.0 define */
/* macro */
#define GET_MODE(command)    (command & 0x000000ffUL)
#define GET_OPT(command)    (command & 0xffffff00UL)

/* header */
#define IPMSG_VERSION            0x0001
#define IPMSG_DEFAULT_PORT        0x0979

/* command */
#define IPMSG_NOOPERATION	0x00000000UL	// 无操作

#define IPMSG_BR_ENTRY		0x00000001UL	// 上线广播
#define IPMSG_BR_EXIT		0x00000002UL	// 下线广播
#define IPMSG_ANSENTRY		0x00000003UL	// 回复
#define IPMSG_BR_ABSENCE	0x00000004UL	// 改为离线状态

#define IPMSG_BR_ISGETLIST	0x00000010UL	// 搜寻有效的主机用户
#define IPMSG_OKGETLIST		0x00000011UL	// 主机列表发送通知
#define IPMSG_GETLIST		0x00000012UL	// 主机列表发送请求
#define IPMSG_ANSLIST		0x00000013UL	// 主机列表发送
#define IPMSG_FILE_MTIME        0x00000014UL	// 
#define IPMSG_FILE_CREATETIME	0x00000016UL	//
#define IPMSG_BR_ISGETLIST2	0x00000018UL	//

#define IPMSG_SENDMSG		0x00000020UL	// 消息传送 
#define IPMSG_RECVMSG		0x00000021UL	// 确认收到消息
#define IPMSG_READMSG		0x00000030UL	// 消息打开通知
#define IPMSG_DELMSG		0x00000031UL	// 消息丢弃通知

/* option for all command */
#define IPMSG_ABSENCEOPT        0x00000100UL
#define IPMSG_SERVEROPT		0x00000200UL
#define IPMSG_DIALUPOPT		0x00010000UL
#define IPMSG_FILEATTACHOPT	0x00200000UL

/* file types for fileattach command */
#define IPMSG_FILE_REGULAR        0x00000001UL
#define IPMSG_FILE_DIR            0x00000002UL
#define IPMSG_LISTGET_TIMER            0x0104
#define IPMSG_LISTGETRETRY_TIMER    0x0105

#define HS_TOOLS        "HSTools"
#define IP_MSG            "IPMsg"
#define NO_NAME            "no_name"
#define URL_STR            "://"
#define MAILTO_STR        "mailto:"
#endif         /* IPMSG_H */
